/*
 * @Author: 李明明
 * @Date: 2021-03-29 09:11:06
 * @LastEditTime: 2021-03-31 21:02:24
 * @LastEditors: 学渣小宝
 * @Description: 核心文件
 * @FilePath: /zhufeng_egg.js_2103/egg-example/app/controller/home.js
 * '
 */
'use strict';

const Controller = require('egg').Controller;

class HomeController extends Controller {
  async index() {
    const { ctx } = this;
    ctx.body = 'HelloWorld';
  }
  async del() {
    const { ctx } = this;
    console.log(ctx.params.articleId);
  }
  async ejs() {
    const { ctx } = this;
    const items = await ctx.service.view.getItems();
    await ctx.render('ejs.ejs', { items });
  }

  async handlebars() {
    const { ctx } = this;
    const items = await ctx.service.view.getItems();
    await ctx.render('handlebars.hbs', { items });
  }

  async nunjunks() {
    const { ctx } = this;
    const items = await ctx.service.view.getItems();
    await ctx.render('nunjunks.nj', { items });
  }
  
}

module.exports = HomeController;
